{extend name="$LAYOUT_SHOP_BASE" /}
{block name="main"}
<div class='wst-toolbar'>
     <input type='hidden' id='grouponId' class="s-ipt" value='{$grouponId}'/>
     <input type='text' class="s-ipt" id='orderNo' placeholder='订单号'/> 
     <select name="payType" id="payType" class="s-ipt">
        <option value="-1">支付方式</option>
        <option value="0">货到付款</option>
        <option value="1">在线支付</option>
     </select>
     <select name="deliverType" id="deliverType" class="s-ipt">
        <option value="-1">配送方式</option>
        <option value="0">送货上门</option>
        <option value="1">自提</option>
     </select>
     <button class="btn btn-primary" onclick="javascript:listByPage()" type='button'><i class="fa fa-search"></i>查询</button>
     <button class='btn f-right' type='button' onclick="javascript:history.go(-1)"><i class="fa fa-angle-double-left"></i>返回</button>
  </div>
  <div class='wst-shop-content'>
    <table class='wst-order-list'>
       <thead>
        <tr class='head'>
           <th>订单详情</th>
           <th>支付方式/配送信息</th>
           <th>金额</th>
           <th>操作</th>
        </tr>
     </thead>
     <tbody id='loadingBdy'>
         <tr id='loading' class='empty-row' style='display:none'>
              <td colspan='4'><img src="__STYLE__/img/loading.gif">正在加载数据...</td>
         </tr>
       </tbody>
       <script id="tblist" type="text/html">
       {{# for(var i = 0; i < d.length; i++){ }}
       <tbody class="j-order-row">
         <tr class='empty-row'>
            <td colspan='4'>&nbsp;</td>
         </tr>
         <tr class='order-head'>
            <td colspan='4' align='right'>
              <div class='time'>{{d[i].createTime}}</div>
              <div class='orderno'>订单号：{{d[i].orderNo}}</div>
              <div>{{d[i].status}}</div>
            </td>
         </tr>
         {{# 
          var tmp = null,rows = d[i]['list'].length;
          for(var j = 0; j < d[i]['list'].length; j++){
             tmp = d[i]['list'][j]; 
         }}
         <tr class='goods-box'>
            <td>
               <div class='goods-img'>
                <a href="{{WST.U('home/goods/detail','id='+tmp.goodsId)}}" target='_blank'>
                <img data-original='__RESOURCE_PATH__/{{tmp.goodsImg}}'  title='{{tmp.goodsName}}' class="gImg">
                </a>
               </div>
               <div class='goods-name'>
                 <div>{{tmp.goodsName}}</div>
                 <div>{{tmp.goodsSpecNames}}</div>
               </div>
               <div class='goods-extra'>{{tmp.goodsPrice}} x {{tmp.goodsNum}}</div>
            </td>
            {{# if(j==0){ }}
            <td rowspan="{{rows}}">
                <div>{{d[i].payTypeName}}</div>
                <div>{{d[i].deliverType}}</div>
            </td>
            <td rowspan="{{rows}}">
                <div>商品金额：¥{{d[i].goodsMoney}}</div>
                <div class='line'>运费：¥{{d[i].deliverMoney}}</div>
                <div>实付金额：¥{{d[i].realTotalMoney}}</div>
            </td>
            <td rowspan="{{rows}}">
        {{#if(d[i].isAppraise==1){}}
        <div style="text-align:center;">已评价</div>
        {{#}else{}}
        <div style="text-align:center;">未评价</div>
        {{#}}}
         <div><a target='blank' href='{{WST.U("home/orders/orderPrint","id="+d[i].orderId)}}'>【打印订单】</a></div>
                <div><a href='#none' onclick='view({{d[i].orderId}})'>【订单详情】</a></div>
            </td>
            {{#}}}
         </tr>
         {{# } }}
       </tbody>
       {{# } }}
       </script>
       <tr class='empty-row'>
            <td colspan='4' id='pager' align="center" style='padding:5px 0px 5px 0px'>&nbsp;</td>
       </tr>
    </table>
  </div>
{/block}
{block name="js"}
<script type="text/javascript" src="__ROOT__/addons/groupon/view/shop/shop.js?v={$v}"></script>
<script>
$(function(){
  listByPage();
})
</script>
{/block}